import 'package:flutter_test/flutter_test.dart';
import 'package:wch_plugin/wch_plugin.dart';
import 'package:wch_plugin/wch_plugin_platform_interface.dart';
import 'package:wch_plugin/wch_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockWchPluginPlatform
    with MockPlatformInterfaceMixin
    implements WchPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final WchPluginPlatform initialPlatform = WchPluginPlatform.instance;

  test('$MethodChannelWchPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelWchPlugin>());
  });

  test('getPlatformVersion', () async {
    WchPlugin wchPlugin = WchPlugin();
    MockWchPluginPlatform fakePlatform = MockWchPluginPlatform();
    WchPluginPlatform.instance = fakePlatform;

    expect(await wchPlugin.getPlatformVersion(), '42');
  });
}
